﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;

using DataFlowModule.Views.DataflowView;
using ELMWCFServiceClass.ELMWCF;
namespace DataFlowModule
{
    /// <summary>
    /// 数据流模块
    /// </summary>
    public class DataflowModule:IModule
    {
        private readonly IRegionManager regionManager;
        private readonly IUnityContainer container;
        public DataflowModule(IRegionManager regionManager, IUnityContainer container)
        {
            this.regionManager = regionManager;
            this.container = container;
        }

        #region IModule Members

        public void Initialize()
        {
            registerViewsAndServices();
            regionManager.RegisterViewWithRegion("DataDetialRegion", () => container.Resolve<IDataflowPresentationModel>().View);
        }
        protected void registerViewsAndServices()
        {


            container.RegisterType<ELMServiceClient>(new InjectionConstructor());
            container.RegisterType<IDataflowView, DataflowView>();
            container.RegisterType<IDataflowPresentationModel, DataflowPrentationModel>();

        }

        #endregion
    }
}
